<?php
 $link = mysql_pconnect("", "reader", "reader");
 mysql_select_db("counter");

// Function definitions

function dbcount($table, $where = "all")
{
    if ($where == "all") {
 	$query = mysql_query("select count(*) from $table");
    } else {
        $query = mysql_query("select count(*) from $table where $where");
    }
    $arr = mysql_fetch_row($query);
    return $arr[0];
}

?>
